home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 07 - 1991 / 07.01 Jan 91 / Object Design / line feed removal / HEROSONAR.C < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-06  |  669 b   |  35 lines  |  [TEXT/KAHL]

  1. /* This file is                   herosona.c                              */
  2. /*
  3. Functions in this file:
  4. 1.  sonar_on      turn on the sonar
  5. 2.  sonar_read    read the sonar, return as an int
  6. 3.  ck_sonar      wait until sonar is finished its last cycle.
  7. */
  8. /* !!!!!!only replace herosona.asm if you read in rmtkey.asm code also!!!*/
  9. #include <hero.h>
  10.  
  11. sonar_on()
  12. {
  13.  hero_call(ENABLE_SONAR);
  14. }
  15.  
  16. sonar_read()
  17. {
  18.  return(  hero_call(READ_SONAR));
  19. }
  20.  
  21.  
  22. /* wait until sonar is finished */
  23. ck_sonar()
  24. {
  25. #asm
  26. ck_s1: LDAA    sonar_st    ; IS SONAR FINISHED?
  27.        BEQ    *+2+$03         
  28.        SWI               ;WAIT UNTIL IT IS
  29.        BRA    ck_s1
  30. #endasm
  31. }
  32.  
  33.  
  34.  
  35.